package com.gz.springcloud.service;

import com.gz.springcloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "seata-account-micro-service")
public interface AccountService {

    /**
     * 老师解读
     * 1. 远程调用方式是 post
     * 2. 远程调用的url 为 http://seata_account_micro_service/account/reduce
     * 3. seata_account_micro_service是nacos注册中心服务名
     * 4. openfeign是通过接口方式调用服务
     */
    /**
     * 扣减账户余额
     */
    @PostMapping("/account/reduce")
    //必须要加@RequestParam
    public Result reduce(@RequestParam("userId")Long userId, @RequestParam("money") Integer money);
}